package com.navi168.fwq21.util;

import android.os.CountDownTimer;
import android.widget.Button;



class TimeCount extends CountDownTimer {
	private Button tButton;
	public TimeCount(long millisInFuture, long countDownInterval,Button tButton) {
		
		super(millisInFuture, countDownInterval);// 参数依次为总时长,和计时的时间间隔
		this.tButton = tButton;
	}

	@Override
	public void onFinish() {// 计时完毕时触发
		tButton.setText("重新获取验证码");
		tButton.setClickable(true);
	}

	@Override
	public void onTick(long millisUntilFinished) {// 计时过程显示
		tButton.setClickable(false);
		tButton.setText(millisUntilFinished / 1000 + "秒");
	}
}
